package test.baojia.act.operation;

import com.alibaba.fastjson.JSONObject;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;

import java.util.Properties;

public class ClickOperation extends Operation {

    @Override
    public void run(JSONObject context, WebDriver driver, Properties resource, JSONObject parentContext) throws  Exception {
        super.run(context, driver, resource, parentContext);
        this.newWebDriverWait(null).until(
                ExpectedConditions.elementToBeClickable(this.makeBy())
        ).click();
    }
}
